MIDI MESSAGES   This chapter provides a short summary of MIDI messages. For full details you should refer to the MIDI Specification document from the Midi User Group. A particular device’s response to messages is given by its MIDI implementation chart. Status Bytes and Data Bytes qqqqqqqqqqqqqqqqqqqqq Each MIDI message consists of a status byte followed by an appropriate number of data bytes. Values between hex 80 to FF make up the 128 kinds of Status Byte. Any value between 00 and 7F is a data byte. It contains information relating to a preceding status byte such as Note Number or Key Velocity. The following table shows the various groups of MIDI messages, in which n represents the MIDI Channel Number.:- Symbol MIDI Message Hex Value DATA BYTES 00 to 7F CHANNEL STATUS BYTES 80 to EF NOF Note Off 8n NON Note On 9n PKP Polyphonic Key Pressure An CCH Control Change Bn PCH Program Change Cn MCP Monophonic Channel Pressure Dn PWL Pitch Wheel En SYSTEM COMMON STATUS BYTES FO to F7 SOX Start of Exclusive F0 MTC Midi Time Code Quarter Frame F1 SPP Song Position Pointer F2 SCH Song Change F3 TRQ Tuning Request F6 EOX End of Exclusive F7 REAL TIME STATUS BYTES F8 to FF CLK Timing Clock F8 STR Sequence Start FA CNT Sequence Continue FB STP Sequence Stop FC SNS Active Sensing FE RST System Reset FF Hexadecimal notation is used throughout this chapter, except where single-digit value is shown without a preceding zero. For example, 03 is hex and 3 is decimal. This chapter doesn’t Include General MIDI (GM) messages or those reserved for future use.   Channel Messages qqqqqqqqqqqqqq These status bytes contain a channel number in the least significant nibble. Each voice can be assigned its own number — it’s done automatically in General MIDI (GM) devices. Although a simple instrument uses only one MIDI channel, multi-timbral devices can use as many channels as you can assign. The lowest numbered of these channels is the Basic Channel — used for information that’s not associated with a particular voice. Channel Voice Messages wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   Channel Voice Messages control an instrument’s voices — only devices or voices assigned to a matching MIDI channel will respond. Running status reduces the number of bytes transmitted and can be crucial for musical timing! In the process a string of data bytes is allowed to follow a single status byte without any other status bytes being sent. For example, a Note On status byte can be followed by any number of ‘note on’ or ‘note off’ data bytes — the latter are ‘note on’ bytes with the velocity (the pressure applied to a key) set to zero. All voice messages, except Monophonic Channel Pressure, use two data bytes. The first specifies the note number and the second indicates the velocity. The Channel Voice messages are:- 80 to 8F: Note Off (NOF) Indicates a key (note) has been released. The second data byte indicates the speed of release or off velocity, sometimes unused and set to hex 40. Messages are in the form:- 8n, kk, vv kk = note number: 34 = middle C (C3) n = MIDI channel between 00 and 15, representing channels 1 to 16 vv = off velocity, usually using a logarithmic scale: 00 = off 01 = 'ppp' 34 = 'mp' 40 = mid position or no sensor 46 = 'mf' FF = 'fff' 90 to 9F: Note On with running status (NON) Indicates a key has been pressed. The second data byte is the applied pressure or on velocity. 9n, kk, vv, kk, vv, - - - n, kk: as Note Off vv = on velocity or Note Off: 00 = note off (using Running Status) 01 to FF = on velocity (see above) A0 to AF: Polyphonic Key Pressure or After Touch (PKP) Indicates the pressure applied to an individual key. This is rarely used — see Monophonic Channel Pressure below. An, kk, vv n, kk, vv: as Note Off (see above) D0 to DF: Monophonic Channel Pressure or After Touch (MCP) Indicates pressure has been applied to the keyboard — it’s often used in preference to Polyphonic Key Pressure (see above) and isn’t specific to any particular key being pressed. Dn, vv n, vv: as Note Off (see above) Channel Mode Messages wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   Channel Mode Messages tell an device how to respond to Voice Messages — they’re sent over the instrument’s Basic Channel. Mode messages control parameters that are universal for a device — such as volume. Although most devices only use one Basic Channel it’s possible to use two or more — allowing a single instrument to behave as if it were several independent synthesisers. The messages are:- B0 to BF: Control Change with running status (CCH) Indicates that a control or switch has moved. Two pairs of data bytes specify which continuous controller or switch has been adjusted and its setting. The 32 14-bit controllers include breath control (1), foot pedal (4), portamento time control (5), data entry slider (6) and main volume (7). Earlier instruments often confuse controllers 4 and 7! All values are encoded using a logarithmic scale and split into a most and least significant byte (MSB and LSB). These controllers can be used in a non-standard way to operate an automated sound mixer — the maximum capacity is 64 7-bit faders (with 0.8 dB resolution) or 32 14-bit faders, plus switches. Four 7-bit controllers are used for sustain, portamento, sostenuto and soft pedals switches. There are a further 19 7-bit controllers, data increment and decrement buttons, two 14-bit parameter controls, a controllers reset switch, a local control switch and switches to set the instrument’s Mode and to send an All Notes Off command. Channel Modes determine how the instrument responds to channel messages. Poly Mode On deselects Mono Mode and vice versa. For a receiver with a Basic Channel of N the responses are: Mode Omni Messages received from 1 On Poly All channels play voices polyphonically 2 On Mono All channels play one monophonic voice 3 Off Poly Channel N plays voices polyphonically 4 Off Mono Channel N through to N+M-1 are assigned monophonically to voices 1 to M For a transmitter with a Basic Channel of N: Mode Omni Messages Sent 1 On Poly All voices to channel N 2 On Mono Mono voice to channel N 3 Off Poly All voices to channel N 4 Off Mono Single voices 1 to M to channels N through to N+M-1 If a receiver can’t accept a mode it may ignore the message or switch to Mode 1. Instruments should default to Mode 1 at startup — but most don’t! Messages are in the form:- Bn, cc, vv, cc, vv, - - - n = MIDI channel number cc = controller number (followed by vv as a controller value unless shown otherwise): 00 to 1F = MSB for 14 bit controllers 00 to 1F (0 to 31): The following are assigned: 01 = breath controller 04 = foot controller 05 = portamento time 06 = data entry slider 07 = main volume 20 to 3F = LSB for above controllers 40 to 5F = 7-bit controllers 40 to 5F (0 to 31) The following are assigned as switches (vv = 00 to 3F for ‘off’, 40 to 7F for ‘on’): 40 = sustain pedal 41 = portamento pedal 42 = sostenuto pedal 43 = 'soft' pedal 60 = data increment button (vv = 7F) 61 = data decrement button (vv = 7F) 62, 63 = manufacturer-specific parameter controller LSB, MSB 64, 65 = universal parameter controller LSB, MSB 79 = reset all controllers (vv = 7F) 7A = Local Control (vv = 00 for ‘off’, 7F for ‘on’) 7B = All Notes Off (vv = 00) 7C = Omni Mode Off/All Notes Off (vv = 00) 7D = Omni Mode On/All Notes Off (vv = 00) 7E = Mono Mode On/All Notes Off vv = M M channels used starting with the Basic Channel vv = 0 all available channels to be used 7F = Poly Mode On/All Notes Off (vv = 00) C0 to CF: Program Change (PCH) Indicates that a voice or patch has been selected. Cn, pp n = MIDI channel number pp = program number E0 to EF: Pitch Wheel (PWL) Indicates the pitch bend controller has moved. Two data bytes are used for the 14-bit data. Sensitivity to pitch bend is determined within the receiver. En, vv, VV n = MIDI channel vv, VV = pitch bend LSB, MSB System Common Messages qqqqqqqqqqqqqqqqqqqq   System Common Messages are sent and received irrespective of MIDI channels. They’re designed to be received by all devices in a MIDI system — assuming they can make use of them! The System Common Messages are:- F1: MIDI Timecode Quarter Frame Message (MTC) At the start of a run of timecode a Full MIDI Timecode Message must be sent (see Real Time System Exclusive messages below). The MTC Quarter Frame message only indicates the current position within a run of timecode. 100 messages are sent per second, using only 7.5% of MIDI’s total bandwidth. Timecode is contained in a data byte spread over 8 messages — hence a full update only occurs on every second frame of timecode. F1, nd n = timecode message type 00 = frames LS nibble 01 = frames MS nibble 02 = seconds LS nibble 03 = seconds MS nibble 04 = minutes LS nibble 05 = minutes MS nibble 06 = hours LS nibble 07 = hours MS nibble d = timecode nibbles assembled by the receiver into data bits. For the hours count:- xyyzzzzz yy = SMPTE timecode type: 0 = 24 frm/s 1 = 25 frm/s 2 = 30 frm/s drop-frame 3 = 30 frm/s non drop-frame zzzzz = hours count (0 to 23) F2: Song Position Pointer (SPP) A count of MIDI beats elapsed as a sequencer plays its song. One beat equals 6 MIDI clocks. F2, pp, PP pp, PP = pointer LSB, MSB F3: Song Change (SCH) Selects the song to be played by a sequencer following a Real Time Start message. F3, ss ss = song number F6: Tuning Request (TRQ) This is rarely used — it doesn’t use any data bytes. F7: End of System Exclusive (EOX) Indicates that System Exclusive data has ended (see below). No data bytes are used. Real Time Messages qqqqqqqqqqqqqqq   Real Time Messages are sent and received irrespective of MIDI channels and have the highest timing priority. They can be interposed between any bytes, perhaps separating status bytes from their data, or even placed in the middle of running status information. Real Time Messages don’t use data bytes. The Real Time messages are:- F8: Timing Clock These ‘pulses’ drive a sequencer at a rate of six clocks per MIDI beat. Each device uses a Song Position Pointer register to count these beats during a sequence. There are 16 beats or 96 clocks per whole note. The relationship between note lengths, beats and clocks is given below:- Note MIDI beats MIDI clocks Semibreve (whole note) 16 96 Minim (half note) 8 48 Crotchet (quarter note) 4 24 Quaver (eighth note) 2 12 Semiquaver (sixteenth note) 1 6 FA: Sequence Start (STR) FB: Sequence Continue (CNT) FC: Sequence Stop (STP) Instructions to a sequencer. FE: Active Sensing (SNS) This feature is optional — it silences an instrument if its MIDI cables are accidentally disconnected. Any device that receives this signal will expect another every 300 milliseconds. If they fail to appear the receiver then defaults to non-sensing mode and turns off all voices. FF: System Reset (RST) This restores all instruments to normal. It’s implemented by the user — not automatically at startup. System Exclusive Messages qqqqqqqqqqqqqqqqqqqqq   Most System Exclusive Messages are specific to particular equipment — the manufacturer determines the rules. They can contain a manufacturer’s identification number (ID) to match the appropriate protocol. They are often used for voice editing or remote control of synthesisers. System Exclusive information must be aimed at particular piece of equipment — this allows two identical devices to share the same MIDI circuit. Hence every instrument is given unique device ID — this often corresponds to the basic channel number. Two special IDs are used for Universal System Exclusive messages that are available to any device — irrespective of the manufacturer! The System Exclusive messages are:- F0: Start of Exclusive (SOX) — Manufacturers System Exclusive This contains a manufacturer’s ID code. F0, ii, xx, - - - xx, F7 ii = manufacturer’s ID The following are examples: 01 = Sequential Circuits 04 = Moog 10 = Oberheim 17 = Linn 18 = Emu 41 = Roland 42 = Korg 43 = Yamaha 44 = Casio 45 = Akai xx = Sysex data determined by the above manufacturer F7 = End Of System Exclusive (EOX) F0: Start of Exclusive (SOX) — Non Real-Time Universal System Exclusive These special messages are directed to specific devices using the device ID. • Set Up Message Used to send instructions to a device that uses MIDI timecode — such as a multi-track recorder or sequencer. F0, 7E, nn, 04, jj, hh, mm, ss, ff, gg, xx, yy, aa, - - aa, F7 7E = ID for Non Real Time Universal nn = device ID 04 = sub ID 1 for MTC jj = sub ID 2 00 = Special 01 = Punch In Point (record mode enable) 02 = Punch Out Point (record mode disable) 03 = Delete Punch In Point from cue list 04 = Delete Punch Out Point from cue list 05 = Event Start Point 06 = Event Stop Point 07 = Event Start Point with additional info 08 = Event Stop Point with additional info 09 = Delete Event Start Point from cue list 0A = Delete Event Stop Point from cue list 0B = Cue Point 0C = Cue Point with additional info 0D = Delete Cue Point 0E = Event Name In Additional Data hh = hours and SMPTE type containing bits organised as: 0yyzzzzz yy = SMPTE timecode type 00 = 24 frm/s 01 = 25 frm/s 02 = 30 frm/s drop-frame 03 = 30 frm/s non drop-frame zzzzz = hours (0 to 23) mm = minutes ss = seconds ff = frames gg = fractional frames (0 to 99) LL = 14-bit event number LSB. Set to zero if jj=00 (Special Mode) MM = 14-bit event number MSB Set to global command if jj=00 (Special Mode): 00 = Timecode Offset 01 = Enable Event List 02 = Disable Event List 03 = Clear 04 = System Stop 05 = Event List Request (sent by master devices to a MTC peripheral) aa = additional info MIDI data is sent as nibbles with LS nibble first. For example a Note On of 93, 48, 7F is sent as 03, 09, 08, 04, 0F, 07. If jj = 0E (Event Name in Additional Data) then ASCII data is sent in the same form — both CR and LF codes must be sent for a new line F7 = End Of System Exclusive (EOX) The following Universal System Exclusive messages are concerned with the transfer of audio samples via MIDI:- • Sample Dump Request Used prior to the transfer of sound sample data between a controlling device and sampler. For best results MIDI circuits should be connected in both directions to create a closed loop with handshaking. After 2 seconds of waiting for any handshake signals the system defaults to open loop operation. F0, 7E, nn, 03, ss, SS, F7 7E = ID for Non Real Time Universal nn = device ID 03 = sub ID 1 for Sample Dump Request ss, SS = stored sample number LSB, MSB F7 = End of System Exclusive (EOX) • Dump Header This is transmitted before sending a sound sample. Where two or three data bytes are used the LSB is sent first. F0, 7E, nn, 01, ss, SS, bb, pp, pp, PP, mm, mm, MM, xx, xx, XX, yy, yy, YY, tt, F7 7E = ID for Non Real Time Universal nn = device ID 01 = sub ID 1 for Dump Header ss, SS = stored sample number bb = number of bits (8 to 28) in each sample pp, pp, PP = sample period in nanoseconds mm, mm, MM = sample length measured in number of sample words xx, xx, XX = sustain loop start point in words from start of the sample yy, yy, YY = sustain loop end in words from end of the sample tt = loop type (00 for ‘forward’, 01 for ‘forward/backward’) F7 = End of System Exclusive (EOX) • Sample Dump Handshake This indicates if a device can accept the data as defined in the Sample Dump Header. F0, 7E, nn, mm, pp, F7 7E = ID for Non Real Time Universal nn = device ID mm = Handshake Mode: 7C = Wait — further handshake message to follow 7D = Cancel — device can’t accept the data 7E = Not Acknowledged (NAK) — device awaiting retransmission of a faulty packet 7F = Acknowledged (ACK) — packet received pp = packet number F7 = End of System Exclusive (EOX) • Sample Dump Packet This is used for the process of dumping a sample. The time taken for transfer may be ten times the sample’s duration — or longer. F0, 7E, nn, 02, pp, dd, dd, -- dd, cc, F7 7E = ID for Non Real Time Universal nn = device ID 02 = sub ID 1 for Sample Dump Packet pp = packet number, restarting from zero as necessary dd = data packets each containing 120 bytes cc = checksum of all data not including any status bytes. F7 = End of Exclusive (EOX) F0: Start of Exclusive (SOX) — Real-Time Universal System Exclusive These messages contain time-related information for a device with a matching device ID. • Full MIDI Timecode Message This message should be sent at the beginning of a run of timecode. F0, 7F, nn, 01, 01, hh, mm, ss, ff, F7 7F = Real Time Universal nn = device ID (7F to select entire system) 01 = sub ID 1 for MIDI Timecode 01 = sub ID 2 for Full Timecode message hh, mm, ss, ff = timecode as in MIDI Cueing Setup Message (see above) F7 = End of System Exclusive (EOX) • User Bits These bits are usually fixed throughout a run of timecode — they’re the same as the User Bits in SMPTE timecode. F0, 7F, nn, 01, 02, 0W, 0w, 0X, 0x, 0Y, 0y, 0Z, 0z, 0g, F7 7F = ID for Real Time Universal nn = device ID (7F to select entire system) 01 = sub ID 1 for MIDI Timecode 02 = sub ID 2 for User Bits W, w = User Byte 1 MS nibble, LS nibble Y, y = User Byte 2 MS nibble, LS nibble — and so on g = SMPTE Binary Group Flag Bits (2 bits only) F7 = End of System Exclusive (EOX) ©Ray White. All Rights Reserved 1997